<!doctype html>
<html class="no-js" lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <!-- Use title if it's in the page YAML frontmatter -->
    <title><%= current_page.data.title || yield_content(:title) %></title>

    <% if content_for?(:swiftype_robot) %>
      <%= yield_content :swiftype_robot %>
    <% else %>
      <meta name="st:robots" content="follow, index">
    <% end %>

    <meta name="flattr:id" content="4zoxle">

    <% feeds.each do |feed| %>
      <%= tag :link,
        href: "/feeds/#{feed[:name]}.rss",
        title: feed[:title],
        rel: "alternate",
        type: "application/rss+xml" %>
    <% end %>

    <%= stylesheet_link_tag "vimcasts" %>
    <%= javascript_include_tag "modernizr" %>
    <%= yield_content :document_head %>
  </head>

<%= partial "ascii-logo" %>

  <body class="<%= page_classes %><%= proof_mode %>" data-swiftype-index='false'>

  <% unless config.environment == :development %>
    <%= partial "google-async-analytics" %>
  <% end %>

  <div class="off-canvas-wrap">
    <div class="inner-wrap">

      <div class="top-bar-underlay"></div>

      <div class="row">
        <nav class="top-bar show-for-large-up" data-topbar>
          <ul class="title-area">
            <li class="name"></li>
            <li class="toggle-topbar menu-icon"><a href="#">Menu</a></li>
          </ul>

          <section class="top-bar-section">

            <% unless current_page.data.searchfeature %>
              <!-- Right Nav Section -->
              <ul class="right search-form-wrapper">
                <li class="has-form">
                <div class="row collapse">
                  <div class="large-12 columns">
                    <%= partial 'search-form' %>
                  </div>
                </div>
                </li>
              </ul>
            <% end %>

            <!-- Left Nav Section -->
            <ul class="left">
              <%= partial "navigation/top", locals: {subnav: homepage?} %>
            </ul>
          </section>
        </nav>

      </div>

      <nav class="compact-nav tab-bar hide-for-large-up">
        <section class="left-small">
          <a class="left-off-canvas-toggle menu-icon" ><span></span></a>
        </section>

        <section class="right tab-bar-section">
          <% unless current_page.data.searchfeature %>
            <%= partial 'search-form' %>
          <% end %>
        </section>
      </nav>

      <aside class="left-off-canvas-menu">
        <ul class="off-canvas-list">
          <li><label>Vimcasts</label></li>
          <%= partial "navigation/top", locals: {subnav: true} %>

          <% unless current_page.data.searchfeature %>
            <li>
              <%= partial 'search-form' %>
            </li>
          <% end %>
        </ul>
      </aside>

      <section class="main-section">

        <div class="identity-row">
          <div id="logo" class="logo">
            <h1>
              <% if current_page.url == "/" %>
                <span>VimCasts.org</span>
              <% else %>
                <a href="/" title="Go to Vimcasts.org homepage">VimCasts.org</a>
              <% end %>
            </h1>
          </div>
          <% if content_for?(:header) %>
            <%= yield_content :header %>
          <% else %>
            <div class="strapline">
              <h2>
              Learn Essential Vim&nbsp;Skills<br/>
              <small><a href="/about/">with&nbsp;Drew Neil, author of Practical&nbsp;Vim</a></small>
            </h2>
          </div>
        <% end %>
        </div>

        <%= yield %>

      </section>

      <a class="exit-off-canvas"></a>

    </div>
  </div>

  <%= javascript_include_tag  "all" %>

  <% if current_page.url == "/episodes/undo-branching-and-gundo-vim/" %>
    <%= javascript_include_tag  "undo-tree-viz" %>
  <% end %>

  </body>
</html>
